<template>
    <view class="login-container">
      <view class="card-container">
        <!-- 顶部登录标题区 -->
        <view class="title-area">
          <text class="brand-text">
            <text class="brand-text-normal">與你相戀到生命盡頭</text>
          </text>
          <view class="title-line"></view>
        </view>
  
          <!-- 手机号一键登录 -->
        <view class="content-area">

            <button class="action-button" @tap="login">手机号一键登录</button>

            <view class="switch-link">
              <text class="switch-text">遇到问题？</text>
              <text class="switch-action" @tap = "handleContact">联系客服</text>
            </view>

        </view>
      </view>
    </view>
    

  </template>
  
<script setup>

const login = () => {
  console.log('登录');
  
	uni.switchTab({
		url: '/pages/tabs/reading/index'
	})
}

const handleLogin = () => {
	console.log('手机号一键登录')
	uni.login({
		provider: 'univerify',
		universifyStyle: {
			fullScreen: true
		},
		success: (res) => {
			console.log('登录成功', res)
			// 登录成功后跳转到阅读页面
			uni.navigateTo({
				url: '/pages/tabs/reading/index'
			})
		},
		fail: (err) => {
			console.log('登录失败', err)
			uni.showToast({
				title: '登录失败，请重试',
				icon: 'none'
			})
		}
	})
}

const handleContact = () => {

	console.log('联系客服')
}

</script>

<style lang="scss" scoped>
    .login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #E8D5FF 0%, #FFB6C1 100%);
  padding: 0 32rpx;

  >.card-container {
  width: 85%;
  max-width: 600rpx;
  background: #FFFFFF;
  border-radius: 24rpx;
  box-shadow: 0 8rpx 16rpx rgba(0, 0, 0, 0.1);
  padding: 48rpx 32rpx;
  margin: 48rpx 0;

  >.title-area {
  text-align: center;
  margin-bottom: 48rpx;

	>.brand-text {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48rpx;
  font-weight: bold;
  margin-bottom: 16rpx;

  .brand-text-normal {
  color: #666666;
  font-size: 32rpx;
  margin-left: 8rpx;
}


}

>.title-line {
  width: 64rpx;
  height: 4rpx;
  background: #FF6B9B;
  margin: 8rpx auto 0;
  border-radius: 2rpx;
}

}

>.content-area{

	.action-button {
  width: 100%;
  height: 96rpx;
  background: #FF6B9B;
  border: none;
  border-radius: 24rpx;
  color: #FFFFFF;
  font-size: 32rpx;
  font-weight: bold;
  margin: 32rpx 0;
  box-shadow: 0 4rpx 8rpx rgba(255, 107, 155, 0.3);
  &:active {
  transform: translateY(2rpx);
  box-shadow: 0 2rpx 4rpx rgba(255, 107, 155, 0.3);
}
}


.switch-link {
  text-align: center;
  margin-top: 32rpx;
.switch-text {
  color: #666666;
  font-size: 28rpx;
}

.switch-action {
  color: #FF6B9B;
  font-size: 28rpx;
  margin-left: 8rpx;
  font-weight: bold;
}
}

}

}



}
  </style>